package com.huirui.server.service.impl;

import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.huirui.server.mapper.ProductParameterMapper;
import com.huirui.server.pojo.entity.ProductParameter;
import com.huirui.server.pojo.vo.ProductParameterVo;
import com.huirui.server.service.ProductParameterService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * @author yujun
 * @description 针对表【t_product_parameter(商品参数表)】的数据库操作Service实现
 * @createDate 2025-09-20 19:22:46
 */
@Service
@Slf4j
public class ProductParameterServiceImpl extends ServiceImpl<ProductParameterMapper, ProductParameter>
        implements ProductParameterService {

    @Override
    public ProductParameterVo getProductParameterInfoByProductId(Long productId) {
        ProductParameter parameter = lambdaQuery()
                .eq(ProductParameter::getProductId, productId)
                .one();
        return BeanUtil.copyProperties(parameter, ProductParameterVo.class);
    }
}




